<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head><title>EHS中国信息管理系统</title>
    <link href="__ROOT__/Public/Css/ehs.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="__ROOT__/Public/Css/doc.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="__ROOT__/Public/Css/news.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="__TMPL__style/Common.css" rel="stylesheet" type="text/css" media="screen" />
    <script type="text/javascript" src="__ROOT__/Public/Js/jquery-1.5.0.min.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/core.js"></script>
    <script type="text/javascript" src="__ROOT__/Public/Js/ehs.js"></script>
  </head>
  <body>
    <layout name="Public:header" cache="0" />
    <div id="container">
      <div id="breakcrump">你所在位置： <a href="" title=""> 首页 </a> > 法规首页 </div>
      <div id="mainbody-index">
        <!--  高级搜索   -->
        <form>
          <div class="mode-search" style="width:960px;">
            <div class="mode-search-title">
              <h2>高级搜索</h2>
            </div>
            <div class="mode-search-cont fliter">
              <table>
                <tr style="display:none">
                  <td>请选择查找类型: </td>
                  <td>
                    <span><a href="#" title="" class="btn-big">行业</a></span>
                    <span><a href="#" title="" class="btn-big">专业</a></span>
                    <span><a href="#" title="" class="btn-big">地区</a></span>
                  </td>
                </tr>
              </table>
              <table>
                <tr>
                  <td>在</td>
                  <td><strong>标题</strong></td>
                  <td>中检索 <input id="txtTitle" type="text" class="txt-input" value=""/></td>
                </tr>
                <tr>
                  <td><select id="select1" ><option value="2">--并且--</option></select>
                  </td>
                  <td><strong>全文</strong></td>
                  <td>中检索 <input id="txtContents" type="text" class="txt-input" value="" /></td>
                </tr>
                <tr>
                  <td><select id="select2"><option value="2">--并且--</option></select></td>
                  <td><strong>颁布单位</strong></td>
                  <td>中检索 <input id="txtUser" type="text" class="txt-input" value="" /></td>
                </tr>
                <tr>
                  <td><select id="select3"><option value="2">--并且--</option></select></td>
                  <td><strong>文号</strong></td>
                  <td>中检索 <input id="txtNumber" type="text" class="txt-input" value="" /></td>
                </tr>
                <tr style="display: none">
                  <td colspan="3">你选择的条件: <a href="#" title="">法规</a> + <a href="" title="">广州</a></td>
                </tr>
                <tr>
                  <td colspan="3"> <input type="button" value="检索" onclick="clickSearch(0)" class="btn-big2"/>  <input type="reset" value="清除" class="btn-big2"/></td>
                </tr>
              </table>
            </div>
          </div>
        </form><!--高级搜索 -->
      </div>
      <div id="divLoading" style="display: none"><img src="__ROOT__/Public/images/loading.gif" /></div>
      <div id="divList" class="search-re-list"></div>
      <div id="divPage" style="text-align: center"></div>
      <layout name="Public:footer" cache="0" />
    </div>
    <script>
      var url = "__URL__";
      function clickSearch(page){
        if ($("#txtTitle").val() == "" && $("#txtContents").val() == "" && $("#txtUser").val() == "" && $("#txtNumber").val() == "" ) {
          alert("请输入要查询的关键字");
          return ;
        }
        $("#divLoading").show();
        var data = {
          select:{2:$("#select1").val(),3:$("#select2").val(),4:$("#select3").val()},
          word:{1:$("#txtTitle").val(),2:$("#txtContents").val(),3:$("#txtUser").val(),4:$("#txtNumber").val()},
          page:page
        };
        ajax.send(url+"/ajaxAdavancedSearch",data,function(obj){
          var data = obj.data;
          var list = data.list;
          var count = data.count;
          var record = data.record;
          var page = data.page;
          replaceHtml("divList", _getHTMLList(list,count,page,record));
          $("#divLoading").hide();
          $("#divPage").html(__foot.html(data.page,data.record,data.count,clickSearch));

        })
      }

      function _getHTMLList(list,count,page,record) {
        var str =[], p = 0;
        if (!list || list == "") return "";
        str[p++] = '<table><thead><tr><td colspan=2 style="font-size:12px">结果显示(<span style="color:red">'+count+'</span>)</td></tr></thead><tbody>';
        for (var i in list) {
          var l = list[i];
          var index = (page*1-1)*record + i*1 + 1;
          str[p++] = '<tr>';
          str[p++] = '<td style="width:5px" align="center">'+index+'</td>';
          str[p++] = '<td><a href="http://www.ehs.cn/law-detail.php?id='+l.id+'">'+l.ltitle+'&nbsp;&nbsp;('+l.luser+l.ldate_pub+')</a></td>';
          str[p++] = '</tr>';
        }
        str[p++] = '</tbody></table>';
        return str.join('');
      }
    </script>
  </body>
</html>
